import ajax from '@/utils/request';

// 按模块配置接口 
export const access = {
	login(data) {
		return ajax.post('/assess/login', data)
	},
	signup(data) {
		return ajax.post('/assess/signup', data)
	},
	updateProfile(data) {
		return ajax.put('/assess/update-profile', data)
	}
};

// 按模块配置接口 
export const food = {
	add(data) {
		return ajax.post('/food/add', data)
	},
	update(data) {
		return ajax.put('/food/update', data)
	},
	detail(id) {
		return ajax.get(`/food/detail/${id}`)
	},
	delete(id) {
		return ajax.delete(`/food/delete/${id}`)
	},
	get(data) {
		return ajax.post('/food/get', data)
	},
};

export const consumer = {
	add(data) {
		return ajax.post('/consumer/add', data)
	},
	update(data) {
		return ajax.put('/consumer/update', data)
	},
	detail(id) {
		return ajax.get(`/consumer/detail/${id}`)
	},
	delete(id) {
		return ajax.delete(`/consumer/delete/${id}`)
	},
	get(data) {
		return ajax.post('/consumer/get', data)
	},
};
export const store = {
	add(data) {
		return ajax.post('/store/add', data)
	},
	update(data) {
		return ajax.put('/store/update', data)
	},
	detail(id) {
		return ajax.get(`/store/detail/${id}`)
	},
	delete(id) {
		return ajax.delete(`/store/delete/${id}`)
	},
	lookup() {
		return ajax.get(`/store/lookup`)
	},
	get(data) {
		return ajax.post('/store/get', data)
	},
};